package homework.api.day08._cp;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        FileOutputStream fos = null;

        try{
            fos = new FileOutputStream("./z/x/c/pwNote.txt");
            fos.write(1);
        }catch (IOException e){
            System.out.println("创建流时出现IO异常");
        }finally {
            try {
                fos.close();
            } catch (Exception e) {
                System.out.println("关闭流时遇到异常");
            }
        }
    }
}
